#include<stdio.h>

/*第二十课：学习while循环*/

int main()
{ 
    int n2;//检测一个数字是不是2的幂次方
    printf("请输入一个整数：\n");
    scanf("%d", & n2);
    while(n2 > 1 && n2 % 2 == 0)
    {
        n2 = n2 / 2;
    }
    if (n2 == 1)
        printf("yes\n");
    else
         printf("no\n");


    double height = 8844.43*1000;//重复折叠纸使厚度超过珠穆朗玛峰
    double i = 0.1;
    int j = 0;
    while (i <= height)
    {
        i *=2;
        j++;
    }
    printf("折叠%d次后纸巾厚度超过珠穆朗玛峰\n",j);

    int dividend, divisor ;//被除数，除数
    int shang = 0;
    printf("请依次输入被除数和除数：\n");
    scanf("%d %d", &dividend,&divisor);
    while (dividend >= divisor)
    {
        dividend -= divisor;
        shang++;
    }
    int yu = dividend;
    printf("两数相除商为%d，余数为%d。\n" ,shang,yu);

    return 0;
}